<template>
  <div class="dashbard-container">
    <!-- 第一行 -->
    <el-row type="flex" justify="space-between" class="top-area">
      <!-- 第一栏 -->
      <el-col :span="6" class="first-row">
        <el-row type="flex" justify="space-between">
          <el-col :span="19" class="top-title">
            <span class="area-title">总答题数量</span>
          </el-col>
          <el-col :span="4">
            <el-tooltip class="item" effect="dark" content="指标说明" placement="top">
              <span>
                <i class="el-icon-info"></i>
              </span>
            </el-tooltip>
          </el-col>
        </el-row>
        <!-- 内容区 -->
        <el-row class="radar-item firsrowarea">
          <el-row class="text">260,560</el-row>
          <el-row type="flex" justify="start" class="footercontent">
            <span>
              周同比 12%
              <i class="el-icon-caret-top"></i>
            </span>
            <span>
              日环比 11%
              <i class="el-icon-caret-bottom"></i>
            </span>
          </el-row>
        </el-row>
        <el-row type="flex" justify="start" class="radar-text">
          <el-col :span="15">
            <span>日答题数量 12,423</span>
          </el-col>
        </el-row>
      </el-col>

      <!-- 第二栏 -->
      <el-col :span="6" class="first-row">
        <el-row type="flex" justify="space-between">
          <el-col :span="16" class="top-title">
            <span class="area-title">试题方向</span>
          </el-col>
          <el-col :span="4">
            <el-tooltip class="item" effect="dark" content="指标说明" placement="top">
              <span>
                <i class="el-icon-info"></i>
              </span>
            </el-tooltip>
          </el-col>
        </el-row>
        <!-- 雷达图 -->
        <radar class="radar-item"/>
        <el-row type="flex" justify="start" class="radar-text">
          <el-col :span="15">
            <span>试题库数量 10,234</span>
          </el-col>
        </el-row>
      </el-col>

      <!-- 第三栏 -->
      <el-col :span="6" class="first-row">
        <el-row type="flex" justify="space-between">
          <el-col :span="16" class="top-title">
            <span class="area-title">试题学科分布</span>
          </el-col>
          <el-col :span="4">
            <el-tooltip class="item" effect="dark" content="指标说明" placement="top">
              <span>
                <i class="el-icon-info"></i>
              </span>
            </el-tooltip>
          </el-col>
        </el-row>
        <!-- 饼形图：南丁格尔 -->
        <pie class="radar-item"/>
        <el-row type="flex" justify="start" class="radar-text">
          <el-col :span="15">
            <span>前端试题数量 5,234</span>
          </el-col>
        </el-row>
      </el-col>

      <!-- 第四栏 -->
      <el-col :span="6" class="first-row">
        <el-row type="flex" justify="space-between">
          <el-col :span="16" class="top-title">
            <span class="area-title">上周试题新增</span>
          </el-col>
          <el-col :span="4">
            <el-tooltip class="item" effect="dark" content="指标说明" placement="top">
              <span>
                <i class="el-icon-info"></i>
              </span>
            </el-tooltip>
          </el-col>
        </el-row>
        <!-- 雷达图 -->
        <bar class="radar-item"/>
        <el-row type="flex" justify="start" class="radar-text">
          <el-col :span="15">
            <span>上周新增总量 1,234</span>
          </el-col>
        </el-row>
      </el-col>
    </el-row>
    <el-row class="footer-area">
      <el-tabs v-model="activeName">
        <el-tab-pane label="前端学科" name="first" class="f-linearea">
          <linearea/>
          <ranking/>
        </el-tab-pane>
        <el-tab-pane label="java学科" name="second" class="f-linearea">
          <linearea :tdata="tdata"/>
          <ranking/>
        </el-tab-pane>
        <el-tab-pane disabled label="前端与java学科试题走势图" class="dis-tabs"></el-tab-pane>
      </el-tabs>
    </el-row>
  </div>
</template>

<script>
import Radar from './components/radar'
import Pie from './components/pie'
import Bar from './components/bar'
import Linearea from './components/Linearea'
import Ranking from './components/Ranking'
export default {
  name: 'Dashboard',
  components: {
    Radar,
    Pie,
    Bar,
    Linearea,
    Ranking
  },
  data() {
    return {
      activeName: 'first',
      tdata: [900, 100, 200, 500, 300, 1500, 800, 500, 688, 100, 156, 500]
    }
  },
  computed: {}
}
</script>

<style lang="scss" scoped>
.dashbard-container {
  margin-top: 30px;
  padding: 0 15px;
  overflow: hidden;
  .top-title {
    text-align: left;
  }
  ::v-deep.el-tabs__nav {
    width: 100%;
    .el-tabs__item:nth-child(2) {
      text-align: center;
      padding: 0 18px;
    }
    .el-tabs__item:nth-child(4) {
      float: right;
      text-align: center;
      padding: 0 18px;
      font-size: 16px;
      color: #808080;
      margin-right: 15px;
    }
  }
  .f-linearea {
    display: flex;
    justify-content: space-between;
    margin-top: -10px;
  }
  .dis-tabs {
    position: absolute;
    right: 0;
  }
  .firsrowarea {
    position: relative;
    width: 220px;
    height: 140px;
    margin: auto;
    .text {
      font-size: 32px;
      margin-top: 50px;
      margin-left: -75px;
    }
    .footercontent {
      position: absolute;
      bottom: 10px;
      font-size: 13px;
      span:nth-child(1) {
        margin-right: 10px;
        i {
          color: red;
          font-size: 14px;
        }
      }
      span:nth-child(2) {
        i {
          color: green;
          font-size: 14px;
        }
      }
    }
  }
  .descripment {
    border: 1px solid deepskyblue;
    padding: 30px;
  }
  .radar-item {
    border-bottom: 1px solid #ccc;
    margin-top: 10px;
    height: 150px;
  }
  .radar-text {
    margin-top: 15px;
    span {
      font-size: 14px;
      color: #000;
    }
  }
  .top-area {
    width: 100%;
    .first-row {
      box-sizing: border-box;
      width: 25%;
      margin-right: 15px;
      border-radius: 5px;
      padding: 20px;
      height: 242px;
      background: #fff;
      text-align: center;
    }
    .first-row:nth-child(4) {
      margin-right: 0;
    }
  }
  .footer-area {
    background: #fff;
    border-radius: 5px;
    margin-top: 15px;
    margin-bottom: 70px;
    text-align: left;
  }
  .el-icon-info {
    color: #808080;
  }
  .area-title {
    font-size: 14px;
    color: #808080;
  }
}
</style>
